home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 44 / Amiga Format CD44 (1999-08-26)(Future Publishing)(GB)(Track 1 of 3)[!][issue 1999-10].iso / -in_the_mag- / basics / amos / moreuselssprgs.lha / Tan.AMOS / Tan.amosSourceCode
AMOS Source Code  |  1997-04-18  |  407b  |  24 lines

  1. Screen Open 0,320,200,2,0
  2. Curs Off : Flash Off : Paper 0 : Pen 1
  3. Degree 
  4. Do 
  5.   MX=X Screen(X Mouse)
  6.   MY=Y Screen(Y Mouse)
  7.   Wait Vbl 
  8.   Cls 
  9.   DX=(160-MX)
  10.   DY=(100-MY)
  11.   If DX<>0
  12.     W=Atan(((DY*256)/DX)/256.0)
  13.   Else 
  14.     If DY<0
  15.       W=90
  16.     Else 
  17.       W=270
  18.     End If 
  19.   End If 
  20.   If DX>0 Then Add W,180
  21.   W=(W+360) mod 360
  22.   Draw 160,100 To 160+Cos(W)*16,100+Sin(W)*16
  23.   Locate 0,20 : Print W
  24. Loop